﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Himall.Entity.Config
{
   public class CouponRecordInfoConfig : EntityTypeConfiguration<CouponRecordInfo>
    {
        public CouponRecordInfoConfig()
        {
            ToTable("Himall_CouponRecord");
            Property(item => item.CounponSN).HasColumnType("varchar").HasMaxLength(100);
            Property(item => item.ShopName).HasColumnType("varchar").HasMaxLength(100);
            Property(item => item.UserName).HasColumnType("varchar").HasMaxLength(100);

            HasRequired(x => x.Himall_Coupon).WithMany(x => x.Himall_CouponRecord).HasForeignKey(x => x.CouponId);
            HasRequired(x => x.Himall_Shops).WithMany(x => x.Himall_CouponRecord).HasForeignKey(x => x.ShopId);
        }
    }
}
